package com.peng.community.mapper;

import com.peng.community.entity.DiscussPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DiscussPostMapper {

    List<DiscussPost> selectDiscussPosts(@Param("userId") int userId, @Param("offset") int offset, @Param("limit") int limit, @Param("mode")int sortMode);

    int selectDiscussPostRows(@Param("userId") int userId);

    int insertDiscussPost(@Param("post")DiscussPost discussPost);

    DiscussPost findDiscussPostById(@Param("id") int id);

    int updateCommentCount(@Param("id") int id, @Param("count")int count);

    int updateStatus(@Param("id") int id, @Param("status") int status);

    int updateType(@Param("id") int id, @Param("type") int type);

    int updateScore(@Param("id") int id, @Param("score") long score);
}
